//
// Decompiled by Jadx - 366ms
//
package fg;

import android.view.View;
import androidx.appcompat.app.t;
import com.google.gson.Gson;
import ff.b;
import ff.c;
import fi.y;
import gc.aa;
import java.util.Calendar;
import java.util.Date;
import me.plusne.MainActivity;
import me.plusne.common.Http.Home;
import me.plusne.common.Json.JsonHomeAppList;
import me.plusne.common.Json.JsonHomeAppVersionList;
import r.h;

public class w$a implements View.OnClickListener {
    public final int a;
    public final w b;

    public w$a(w wVar, int i) {
        this.b = wVar;
        this.a = i;
    }

    @Override
    public final void onClick(View view) {
        JsonHomeAppList.DataBean dataBean;
        b bVar = this.b.c;
        if (bVar != null) {
            MainActivity mainActivity = bVar.a;
            JsonHomeAppList jsonHomeAppList = mainActivity.aa.b;
            if (jsonHomeAppList != null) {
                dataBean = (JsonHomeAppList.DataBean) jsonHomeAppList.getData().get(this.a);
            } else {
                dataBean = null;
            }
            if (view.getId() == 0x7f82017d) {
                new Thread((Runnable) new aa(7, mainActivity, dataBean)).start();
                return;
            }
            JsonHomeAppVersionList jsonHomeAppVersionList = (JsonHomeAppVersionList) new Gson().fromJson(fn.b.g("HomeAppVersionList_" + dataBean.getPre(), ""), JsonHomeAppVersionList.class);
            if (jsonHomeAppVersionList != null && jsonHomeAppVersionList.getData() != null) {
                int toHour = jsonHomeAppVersionList.getToHour();
                Date date = h.a;
                if (toHour == Calendar.getInstance().get(11)) {
                    mainActivity.ac(jsonHomeAppVersionList);
                    return;
                }
            }
            y.f(mainActivity, "请求网络中...");
            t.c().j(((Home) dq.b.b(Home.class)).getAppVersionList(dataBean.getPre()).subscribeWith(new c(mainActivity, mainActivity, dataBean)));
        }
    }
}
